package StudyCode.summary.myfile;

import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.attribute.BasicFileAttributes;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class GetCreationTimeByBasicFileAttributes {
	public static void main(String[] args) {
		Path path = FileSystems.getDefault().getPath("E:\\迅雷下载\\test1.txt");
		try {
			BasicFileAttributes attributes = Files.readAttributes(path, BasicFileAttributes.class);
			System.out.println("创建时间: " + attributes.creationTime());
		} catch (IOException ex) {
			ex.printStackTrace();
		}
	}
}
